#ifndef _INDEX_H_
#define _INDEX_H_

#include "avl_tree.h"
#include <stddef.h>
#include <stdint.h>

typedef struct index_attr_t index_attr;

typedef struct index_t {
    int                   attr_count;
    int                   max_attr;
    int                   max_elem;
    avl_tree             *database;
    index_attr           *attributes;
} index_t;


index_t *
index_new(int max_elem, 
          int max_attr, 
          avl_compare_fn comp_fn, 
          avl_free_fn free_fn, 
          int opts);

void
index_create_attribute(index_t *index, size_t offset, size_t len);


void
index_insert(index_t *index, void *item, void *ctx);

#endif

